import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/index.vue'

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@/views/dashboard/index.vue'),
        meta: { title: '首页' }
      },
      {
        path: 'user',
        component: () => import('@/views/system/user.vue'),
        meta: { title: '用户管理' }
      },
         {
        path: 'department',
        component: () => import('@/views/department/index.vue'),
        meta: { title: '部门管理' }
      },
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login/index.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router